﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wuqi.Webdiyer;
namespace StoreWeb.system.message
{
    public partial class list : System.Web.UI.Page
    {
        BLL.Message message = new BLL.Message();
        //BLL.Role role = new BLL.Role();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int totalOrders = message.GetRecordCount("");
                AspNetPager1.RecordCount = totalOrders;
            }
        }
        void bindData(string where)
        {

            //Repeater1.DataSource = role.GetListByPage("", "", AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex);
            //Repeater1.DataBind();
            Repeater1.DataSource = message.GetListByPage(where, "", AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex);
            Repeater1.DataBind();
        }

        protected void AspNetPager1_PageChanged(object src, EventArgs e)
        {
            bindData(hidwhere.Value);
        }

        protected void btnserach_Click(object sender, EventArgs e)
        {

            string where = "1=1 ";
            if (mmobile.Value != null && !string.IsNullOrEmpty(mmobile.Value))
            {
                where += " and mobile = '" + mmobile.Value + "'";
            }
            if (mname.Value != null && !string.IsNullOrEmpty(mname.Value))
            {
                where += " and username = '" + mname.Value + "'";
            }
            hidwhere.Value = where;
            bindData(hidwhere.Value);
        }
    }
}